package com.ep.modules.app.controller;

import com.ep.common.annotation.SysLog;
import com.ep.common.utils.PageUtils;
import com.ep.common.utils.R;
import com.ep.common.validator.ValidatorUtils;
import com.ep.modules.app.entity.AppTeamTask;
import com.ep.modules.app.service.AppTeamTaskService;
import java.util.Map;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/team_task")
public class AppTeamTaskController {
    @Autowired
    private AppTeamTaskService appTeamTaskService;

    @GetMapping("/list")
    public R list(Map<String, Object> params) {
        PageUtils page = appTeamTaskService.queryPage(params);
        return R.ok().put("page", page);
    }

    @GetMapping("/info/{id}")
    public R info(@PathVariable Long id) {
        AppTeamTask appteamtask = appTeamTaskService.getById(id);
        return R.ok().put("appteamtask", appteamtask);
    }

    @SysLog("保存AppTeamTask")
    @PostMapping("/save")
    public R save(@RequestBody AppTeamTask appteamtask) {
        ValidatorUtils.validateEntity(appteamtask);
        appTeamTaskService.save(appteamtask);
        return R.ok();
    }

    @SysLog("修改AppTeamTask")
    @PostMapping("/update")
    public R update(@RequestBody AppTeamTask appteamtask) {
        ValidatorUtils.validateEntity(appteamtask);
        appTeamTaskService.update(appteamtask);
        return R.ok();
    }

    @SysLog("删除AppTeamTask")
    @PostMapping("/delete")
    public R delete(@RequestBody Long[] ids) {
        appTeamTaskService.deleteBatch(ids);
        return R.ok();
    }
}